import { _decorator, Component, Node } from 'cc';
import RowFallClear_WinLosePanel from './RowFallClear_WinLosePanel';
import RowFallClear_GameManager from '../Manager/RowFallClear_GameManager';

const { ccclass, property } = _decorator;

@ccclass('RowFallClear_ResurrectionPanel')
export default class RowFallClear_ResurrectionPanel extends Component {
    public static Instance: RowFallClear_ResurrectionPanel;
    @property(Node)
    Button_ok: Node | null = null;
    @property(Node)
    Button_cancel: Node | null = null;
    onLoad() {
        RowFallClear_ResurrectionPanel.Instance = this;
    }
    start() {
        this.Button_ok.on('click', this.click_ok, this);
        this.Button_cancel.on('click', this.click_cancel, this);
    }
    ShowOn() {
        this.node.active = true;
    }
    ShowOff() {
        this.node.active = false;
    }
    click_ok(button) {
        this.ShowOff();
        RowFallClear_GameManager.Instance.Resurrection();
    }
    click_cancel(button) {
        this.ShowOff();
        RowFallClear_WinLosePanel.Instance.ShowOn(2);
    }
}